/*
 * list.h
 *
 *  Created on: 2021年6月13日
 *      Author: limao
 */

#ifndef LIST_H_
#define LIST_H_

#include "datacontainer.h"

typedef unsigned int list_error;

#define  LIST_MAX_NUMBER         20


struct list_node {
	struct list_node *per;
	struct list_node *next;
	void *data;
};

struct list{
	struct list_node *head, *tail;
	int len;
};

struct list *InitList(void *pdata);
void DeinitList(struct list *self);

list_error list_insert_node(struct list *self, int insert_index , void *pdata);
list_error list_delet_node(struct list *self, int insert_index);
void *get_node_data(struct list *self, unsigned int node);

unsigned int get_list_number(void);
unsigned int get_node_number(struct list *self);


#endif /* LIST_H_ */
